/*
 * Copyright (c) 2021. Moses All Right Reserved
 */

package com.moses.enums;

/**
 * @author Moses
 * @email shenhuohui@gmail.com
 * @date 2021/5/23 17:57
 */
public class Client {
    public static void main(String[] args) {
        Week week = Week.FRIDAY;
        System.out.println(week);

        AdvanceWeek advanceWeek = AdvanceWeek.FRIDAY;
        System.out.println(advanceWeek);
        System.out.println(advanceWeek.getDescription());
        System.out.println(advanceWeek.absMethod());

        for(AdvanceWeek advanceWeek1: AdvanceWeek.values()){
            System.out.println(advanceWeek1.name() + ":" + advanceWeek1.getDescription());
        }

        // 最终 enum 会编译一个抽象 AdvanceWeek 类，该类继承于 Enum<AdvanceWeek>
        // 相当于 abstract class AdvanceWeek extends Enum<AdvanceWeek>
        // 每一个实例则编译成该类的一个 final 子类即继承于 AdvanceWeek
        // 类名为 AdvanceWeek$1, AdvanceWeek$2 以此类推
        // 相当于 final AdvanceWeek$1 extends AdvanceWeek
    }

    public static final Client ONE = new Client();
    public static final Client TWO = new Client();
    public static final Client THREE = new Client();
}
